﻿Namespace FTTK.Entities.Rest
    <Serializable()>
    Public NotInheritable Class SearchResultsOrder

        Private Sub New()

        End Sub

        Public Shared Function FromEntityOrder(order As Entities.SearchResultsOrder) As String
            Select Case order
                Case Entities.SearchResultsOrder.Creation
                    Return SearchResultsOrder.Creation
                Case Entities.SearchResultsOrder.DownloadNumbers
                    Return SearchResultsOrder.NbDownloads
                Case Entities.SearchResultsOrder.Price
                    Return SearchResultsOrder.Price1
                Case Entities.SearchResultsOrder.Relevance
                    Return SearchResultsOrder.Relevance
                Case Else
                    Return SearchResultsOrder.NbViews
            End Select
        End Function

        Public Shared ReadOnly Property Relevance As String
            Get
                Return "relevance"
            End Get
        End Property


        Public Shared ReadOnly Property Price1 As String
            Get
                Return "price_1"
            End Get
        End Property

        Public Shared ReadOnly Property Creation As String
            Get
                Return "creation"
            End Get
        End Property

        Public Shared ReadOnly Property NbViews As String
            Get
                Return "nb_views"
            End Get
        End Property

        Public Shared ReadOnly Property NbDownloads As String
            Get
                Return "nb_downloads"
            End Get
        End Property

    End Class
End Namespace